Endpoint
Path Parameters
string
required
Unique identifier for the room to clean up.
Response
Success (200 OK)
boolean
Always
true when cleanup completes.string
The room ID that was cleaned up.
Partial Success (207 Multi-Status)
Returned when cleanup completes but some operations failed:boolean
Always
true even when errors occur.string[]
Array of error messages from failed cleanup operations (e.g., sandbox destruction failures).
Example Request
Example Response (Success)
Example Response (Partial Success)
Cleanup Operations
The endpoint performs the following cleanup tasks:- Reset Agent State - Clears the conversation history (sets
messagesarray to empty) - Destroy Sandbox - Terminates the
sandbox-{roomID}instance and removes its resources
Error Handling
The cleanup endpoint is designed to be resilient:- Best-effort cleanup: Even if sandbox destruction fails, the agent state is still reset
- Partial success reporting: Returns 207 status with error details rather than failing completely
- No rollback: Successful cleanup operations are not reversed if later operations fail
Error Responses
404 Not Found
Returned when the room ID is missing from the URL path.405 Method Not Allowed
Returned when using a method other than DELETE.Use Cases
- End of conversation session cleanup
- Resource management and memory optimization
- Resetting a room to initial state
- Automated cleanup in test environments
Client Implementation Example
From internal/ai/client.go:106-125:Related Endpoints
- POST /api/rooms//message - Send messages to the AI assistant
- POST /api/rooms//sandbox/exec - Execute sandbox commands